package com.nacos.test.controller;

import com.nacos.test.UserServcie;
import com.nacos.test.pojo.User;
import com.nacos.test.utils.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 项目名称：nacos_parent
 * 类 名 称：UserController
 * 类 描 述：TODO
 * 创建时间：2020/5/19
 * 创 建 人：Areli
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserServcie userServcie;

    @GetMapping()
    public JSONResult queryAll(){
        List<User> users = userServcie.queryAll();
        return JSONResult.ok(users);
    }
}
